#ifndef VPXDECODER_H
#define VPXDECODER_H

#include "libyuv.h"
#include <QOpenGLWidget>
#include <QDateTime>
#include <QDebug>
#include <QImage>
#include <QPainter>
class VPxDecoder :  public QOpenGLWidget
{
    Q_OBJECT
public:
    explicit VPxDecoder(QWidget *parent = nullptr);
    ~VPxDecoder() ;
    void paintEvent(QPaintEvent *) override;

    int decode_(int pox,int poy,int imageWidth,int imageHeight,QByteArray *in);
    void ConvertARPG(int pox,int poy,int imageWidth,int imageHeight,QByteArray &data);
    uchar*  _rgbBuffer{nullptr};
    int _data_length{0};
    QPixmap m_pixmap ;
    QPixmap lastMap ;

signals:
    void vpxDecoderOkARGBImage(int pox,int poy,QImage image);

};

#endif // VPXDECODER_H
